<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Helper;
use App\Models\Server;
use App\Models\Account;
use Illuminate\Database\Eloquent\SoftDeletes;

class PlayerMoneyLog extends Model
{
    use SoftDeletes;

    /**
     * 应该被调整为日期的属性
     *
     * @var array
     */
    protected $dates = ['deleted_at'];
    protected $table = 'player_money_logs';

    protected $guarded = [];

    public function getPlayerData()
    {
        $server = Server::find($this->server_id);
        Helper::setDataBaseConf('mysql_auth',$server,'acore_auth');
        $player = Account::find($this->player_id);
        return $player;
    }
}
